Setup MCP Server
Used to complete MCP (Model Context Protocol) server setup and configuration. This allows you to configure the connection details, authentication, transport protocol, and other settings required to establish a working connection with an MCP server.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://api.seliseblocks.com/tools/mcp-server-setup/{tool_id} |
Request
Request Example
curl -X POST 'https://api.seliseblocks.com/tools/mcp-server-setup/{tool_id}' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"server_url": "https://mcp-server.example.com",
"transport": "streamable_http",
"headers": {
"X-Custom-Header": "value"
},
"query_params": {},
"trust_mcp_server": true,
"auth_config": {
"Enabled": true,
"APIToken": "your-api-token",
"APIKeyPrefix": "Bearer",
"APIKeyName": "Authorization"
},
"skip_discovery": false,
"project_key": "YOUR_PROJECT_KEY"
}'
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| tool_id | string | Yes | The unique identifier of the MCP server tool. |
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data type, must be application/json. |
Request Body
Request Body Schema
{
"server_url": "string",
"transport": "streamable_http",
"headers": {},
"query_params": {},
"trust_mcp_server": true,
"auth_config": {
"Enabled": false,
"OAuth2Config": {
"ClientID": "string",
"ClientSecret": "string",
"TokenURL": "string",
"Scopes": ["string"],
"RefreshToken": "string",
"AccessToken": "string",
"TokenExpiresAt": "2026-01-12T07:28:51.601Z",
"GrantType": "client_credentials",
"AuthorizationEndpoint": "string",
"RedirectURI": "string",
"PKCEConfig": {
"CodeVerifier": "string",
"CodeChallenge": "string",
"CodeChallengeMethod": "S256"
},
"State": "string",
"Nonce": "string"
},
"APIToken": "string",
"APIKeyPrefix": "Bearer",
"APIKeyName": "Authorization",
"AutoDiscoverMetadata": false,
"ServerMetadata": {
"Issuer": "string",
"AuthorizationEndpoint": "string",
"TokenEndpoint": "string",
"RevocationEndpoint": "string",
"IntrospectionEndpoint": "string",
"RegistrationEndpoint": "string",
"ScopesSupported": ["string"],
"ResponseTypesSupported": ["string"],
"GrantTypesSupported": ["string"],
"CodeChallengeMethodsSupported": ["string"]
}
},
"skip_discovery": false,
"project_key": "string"
}
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| server_url | string | Yes | The URL endpoint of the MCP server. |
| transport | string | Yes | Transport protocol (e.g., "streamable_http"). |
| headers | object | No | Custom HTTP headers to include in requests to the MCP server. |
| query_params | object | No | Query parameters to append to MCP server requests. |
| trust_mcp_server | boolean | No | Whether to trust the MCP server's SSL certificate (default: true). |
| auth_config | object | No | Authentication configuration for the MCP server. |
| skip_discovery | boolean | No | Skip automatic discovery of MCP server capabilities (default: false). |
| project_key | string | Yes | The project key for your project. |
Authentication Configuration Parameters
| Field | Type | Description |
|---|---|---|
| Enabled | boolean | Whether authentication is enabled. |
| OAuth2Config | object | OAuth 2.0 authentication configuration. |
| APIToken | string | API token for token-based authentication. |
| APIKeyPrefix | string | Prefix for API key (e.g., "Bearer", "Token"). |
| APIKeyName | string | Name of the header or parameter for the API key. |
| AutoDiscoverMetadata | boolean | Automatically discover OAuth server metadata. |
| ServerMetadata | object | Manual OAuth server metadata configuration. |
OAuth2 Configuration Parameters
| Field | Type | Description |
|---|---|---|
| ClientID | string | OAuth 2.0 client identifier. |
| ClientSecret | string | OAuth 2.0 client secret. |
| TokenURL | string | URL endpoint for obtaining access tokens. |
| Scopes | array | List of OAuth scopes to request. |
| RefreshToken | string | Refresh token for obtaining new access tokens. |
| AccessToken | string | Current access token. |
| TokenExpiresAt | string | Timestamp when the access token expires (ISO 8601 format). |
| GrantType | string | OAuth grant type (e.g., "client_credentials", "authorization_code"). |
| AuthorizationEndpoint | string | URL endpoint for user authorization. |
| RedirectURI | string | Redirect URI for OAuth callback. |
| PKCEConfig | object | PKCE (Proof Key for Code Exchange) configuration. |
| State | string | State parameter for CSRF protection. |
| Nonce | string | Nonce value for additional security. |
note
MCP Server Setup Requirements
- transport: Currently supports "streamable_http" for streaming HTTP connections
- auth_config: Choose between OAuth 2.0 or API token authentication
- OAuth 2.0: Supports multiple grant types including client_credentials, authorization_code, and refresh_token
- PKCE: Recommended for enhanced security in OAuth flows
- trust_mcp_server: Set to false in production environments with self-signed certificates
tip
After setting up an MCP server, the system will:
- Validate the server URL and connection
- Test authentication credentials if provided
- Discover available MCP server capabilities (unless skip_discovery is true)
- Register the server's tools and resources
- Make the MCP server available for use with AI agents
- Store configuration securely for future connections
Response
Success Response (200 OK)
Returns an object containing the setup status.
{
"is_success": true,
"item_id": "mcp_server_123",
"detail": "MCP server setup completed successfully. 12 tools discovered.",
"error": {}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the setup was successful. |
| item_id | string | The identifier of the configured MCP server. |
| detail | string | Success or failure message with additional context. |
| error | object | Error details if the operation failed (empty if successful). |
Error Response (422 Unprocessable Entity)
Returns validation error details when the request body is invalid.
{
"detail": [
{
"loc": [
"body",
"server_url"
],
"msg": "invalid URL format",
"type": "value_error.url"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., body field). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 400 | Bad Request - Invalid configuration | Bad Request |
| 401 | Unauthorized - Authentication failed | Unauthorized |
| 404 | Not Found - MCP server tool does not exist | Not Found |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |
| 503 | Service Unavailable - Cannot connect to MCP server | Service Unavailable |